﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Attributes_for_Actions.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewData["Message"] = "Welcome to ASP.NET MVC!";

            return View();
        }

        [AcceptVerbs("GET")]
        public ActionResult Update()
        {
            //ShowUpdateForm
            ViewData["Message"] = "Welcome to the About Page with GET!";
            return View();
        }

        [AcceptVerbs("POST")]
        //[AcceptVerbs(HttpVerbs.Post | HttpVerbs.Get)]
        public ActionResult Update(FormCollection form)
        {
            //ProcessUpdateForm
            ViewData["Message"] = "Welcome to the About Page with POST!";
            return View();
        }

        [ActionName("View")]
        public ActionResult NotTheSameView()
        {
            ViewData["Title"] = "View Page";
            ViewData["Message"] = "Welcome to the View page from the method NotTheSameView";

            return View();
        }

        [NonAction]
        public void ThisIsNotAnAction()
        {
            //do some stuff
        }
    }
}
